<div class="listaPermissao">
<% def idx = 0
  mapa.each{controle, listaAcoes -> %>
        <g:if test="${listaAcoes}">
          <ul>
            <li>${message(code:'controle.'+controle)}</li>
            <li>
                <ul>
                <%listaAcoes.each{acao,nomeAcao ->
                   def id = (listaDePermissoes?.find{(it.url==('/'+controle+'/'+acao+"/**"))}?.id)?:""
                %>
                    <li>
                        <input type="checkbox" name="listaDePermissao[${idx}].checked" ${id?'checked="checked"':''} value="${acao}" /> ${nomeAcao}
                        <input type="hidden" name="listaDePermissao[${idx}].url" value="${"/"+controle+"/"+acao+"/**"}" />
                        <input type="hidden" name="listaDePermissao[${idx}].id" value="${id}" />
                    </li>
                <%  idx++
                  }%>
                </ul>
            </li>
          </ul>
        </g:if>
 <%}%>
</div>